package com.qianda.qdminiapp.config;

import com.qianda.qdminiapp.common.rabbitmq.MsgProducer;
import com.qianda.qdminiapp.dao.account.QqdAccountDao;
import com.qianda.qdminiapp.dao.account.QqdAccountTradeDao;
import com.qianda.qdminiapp.dao.device.DeviceDao;
import com.qianda.qdminiapp.dao.device.QqdDeviceDao;
import com.qianda.qdminiapp.dao.device.QqdStoreDao;
import com.qianda.qdminiapp.dao.order.OrderDao;
import com.qianda.qdminiapp.dao.order.QqdOrderInfoDao;
import com.qianda.qdminiapp.dao.order.QqdOrderTowelDao;
import com.qianda.qdminiapp.dao.personmanage.QqdCompanyDao;
import com.qianda.qdminiapp.dao.user.QqdUserDao;
import com.qianda.qdminiapp.dao.user.UserDao;
import com.qianda.qdminiapp.service.CommondManager;
import com.qianda.qdminiapp.service.order.BalancePaymentImpl;
import com.qianda.qdminiapp.service.order.QqdPaymentImpl;
import com.qianda.qdminiapp.service.order.WxPaymentImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName OrderStrategyConfig
 * @Author cw
 * @Date 2019/8/7 15:48
 * @Version 1.0
 */
@Configuration
public class OrderStrategyConfig {

    @Bean
    public WxPaymentImpl wxPaymentImpl(QqdUserDao userDao, QqdOrderInfoDao orderInfoDao, QqdOrderTowelDao qqdOrderTowelDao,
                                       CommondManager commondManager, QqdDeviceDao deviceDao,
                                       WxpayProperties wxpayProperties, QqdStoreDao qqdStoreDao,
                                       QqdAccountTradeDao qqdAccountTradeDao, MsgProducer msgProducer, QqdCompanyDao qqdCompanyDao){
        return new WxPaymentImpl(userDao, orderInfoDao,qqdOrderTowelDao, commondManager, deviceDao,wxpayProperties,qqdStoreDao,qqdAccountTradeDao,msgProducer,qqdCompanyDao);
    }

    @Bean
    public QqdPaymentImpl qqdPaymentImpl(QqdUserDao userDao, QqdOrderInfoDao orderInfoDao, QqdOrderTowelDao qqdOrderTowelDao,
                                         CommondManager commondManager, QqdDeviceDao deviceDao, QqdStoreDao qqdStoreDao,QqdAccountTradeDao qqdAccountTradeDao,MsgProducer msgProducer, QqdCompanyDao qqdCompanyDao){
        return  new QqdPaymentImpl(userDao, orderInfoDao,qqdOrderTowelDao, commondManager, deviceDao,qqdStoreDao,qqdAccountTradeDao,msgProducer,  qqdCompanyDao);
    }

    @Bean
    public BalancePaymentImpl balancePaymentImpl(QqdUserDao userDao, QqdOrderInfoDao orderInfoDao, QqdOrderTowelDao qqdOrderTowelDao,
                                                 CommondManager commondManager, QqdDeviceDao deviceDao,
                                                 QqdAccountDao qqdAccountDao, QqdStoreDao qqdStoreDao,QqdAccountTradeDao qqdAccountTradeDao,MsgProducer msgProducer, QqdCompanyDao qqdCompanyDao){
        return new BalancePaymentImpl(userDao, orderInfoDao,qqdOrderTowelDao, commondManager, deviceDao,qqdAccountDao,qqdStoreDao,qqdAccountTradeDao,msgProducer,qqdCompanyDao);
    }

}
